package com.twu.biblioteca.Customers;

import com.twu.biblioteca.Menus.CustomerMenu;

public class Customer {

    private String userName;
    private String password;
    private String name;
    private String email;
    private String phone;
    private boolean loginFlag;

    public boolean getLoginFlag(){
        return this.loginFlag;
    }

    public void setLoginFlag(boolean flag){
        this.loginFlag = flag;
    }

    public Customer(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }

    public void checkMemberShip() {
       CustomerMenu customerMenu = new CustomerMenu();
        if(loginFlag){
            System.out.println(name+"-"+email+"-"+phone);
        }
       customerMenu.menuMessages();
    }

    public void login() {
        CustomerCollection cc = new CustomerCollection();
        this.loginFlag = cc.checkUsernameAndPassword(this);
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
